<extend name="Public:index" />
<block name="mycss">
    <style type="text/css">

    </style>
</block>
<block name="main-content">
    <div class="container-fluid">
        <div class="row">
            <div class="col-12">
                <div class="card">
                    <div class="card-body">
                        <form class="form-inline definewidth m20" action="__ACTION__" method="post">
                            <table style="width:100%">
                                <tr>

                                    <td style="width:33.33%;">
                                        <div class="input-group mb-3">
                                            <div class="input-group-prepend">
                                                <span class="input-group-text" id="basic-addon1">用户名：</span>
                                            </div>
                                            <input type="text" class="form-control" id="susername" name="susername"
                                                value="{$susername}">
                                            <div class="input-group-append">
                                                <button class="btn btn-primary" type="submit" id="button-addon2">搜索</button>
                                            </div>
                                        </div>
                                    </td>
                                    <td style="width:33.33%; text-align:right">
                                        <div class="btn-group mb-3" role="group" aria-label="...">
                                            <a class="btn btn-sm btn-primary" href="{:U('edit')}">
                                                <i class="ace-icon fa fa-plus"></i> 添加用户
                                            </a>
                                        </div>
                                    </td>
                                </tr>
                            </table>
                            <table class="table table-bordered table-hover m10">
                                <tr>
                                    <th>编号</th>
                                    <th>用户名</th>
                                    <th>角色</th>
                                    <th>用户禁用</th>
                                    <th>是否项目管理员</th>
                                    <th>可建项目数目</th>
                                    <th>模版包</th>
                                    <th>操作时间</th>
                                    <th>管理操作</th>
                                </tr>
                                <volist name="rolelist" id="mlist">
                                    <php>
                                        $mids = explode(',', $mlist['module_ids']);
                                        $mb = array();
                                        foreach($mids as $m){
                                            $mb[] = $mobans[$m];
                                        }
                                    </php>
                                    <tr>
                                        <td>{$mlist[userid]}</td>
                                        <td><a href="{:U('editpwd',array('userid'=>$mlist['userid'],'username'=>$mlist['username']))}"
                                                data-url=''>{$mlist.username}</a></td>
                                        <td>{$mlist.rolename}</td>
                                        <td>{$mlist[isforbidden] ? '禁用' : '启用'}</td>
                                        <td>{$mlist['is_admin'] ? '是' : '否'}</td>
                                        <td>{$mlist.project_num}</td>
                                        <td>{$mb|implode=',',###}</td>
                                        <td>{$mlist[updated_at]}</td>
                                        <td>
                                            <a href="{:U('edit',array('userid'=>$mlist['userid']))}">编辑</a>&nbsp;&nbsp;
                                            <!-- <a href="__APP__/web/SetAuthority/index?id={$mlist[userid]}&t=2">设置操作用户权限</a>-->&nbsp;&nbsp;
                                            |&nbsp;&nbsp;
                                            <a href="javascript:if(confirm('确认删除？'))location='{:U('deletes',array('id'=>$mlist[userid]))}'">删除</a>

                                        </td>
                                    </tr>
                                </volist>
                            </table>
                            {$page}
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</block>
<block name="myscript">
    <script>







    </script>
</block>